<?php
/**
 * User: 魔十七
 * Date: 2020/11/4
 * Time: 10:17
 */

namespace Samecity\Controller;

use Think\Controller;
class CommonCategoryController  extends Controller
{
    /**
     * 获取课程类表
     */
    public function getCourse(){
        $list=M('course')->field('title,id')->select();
        $back = array(
            "code"=>0,
            "msg"=>"成功",
            "data"=>$list,
        );
        $this->ajaxReturn($back);
    }

    public function abc(){
        $sql = "(SELECT id,add_time,name FROM samecity_car_trading)
                    UNION ALL
                (SELECT id,add_time,name FROM samecity_business_transfer)
                ORDER BY add_time DESC";
        $res = M()->query($sql);
        var_dump($res);
    }
}